<template>
    <div class="sale-retriction-suppliers-detail">
        <search-form :searchArray="searchArray">
            <el-button type="primary" class="search btn mL20" @click="goAdds()">添加产品与药店配置</el-button>
            <el-button type="primary" class="search btn mL20" @click="goAddsArea()">添加产品与区域配置</el-button>
        </search-form>
        <elTable :formData="formData" @tableData="getList" ref="dataInfo">
                <el-table-column prop="group" label="产品名称" align="center"></el-table-column>
                <el-table-column prop="group" label="供应商产品ID" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="规格" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="批准文号" align="center"></el-table-column>
                <el-table-column prop="loginTime" label="生产厂家" align="center"></el-table-column>
                <el-table-column prop="action" label="操作" align="center" width="200px">
                    <template slot-scope="scope">
                        <el-button type="text"  @click="pharmacySetting(scope.row)">药店配置</el-button>
                        <el-button type="text"  @click="areaSetting(scope.row)">区域配置</el-button>
                        <el-button type="text"  @click="deletes(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
        </elTable>
        <dialogs 
            :visible="showPharmacyDialog"
            title="查看店铺"
        >
        <elTable :formData="formData" @tableData="getList" ref="dataInfo">
            <el-table-column prop="group" label="药店名称" align="center"></el-table-column>
            <el-table-column prop="group" label="状态：限销/可销" align="center"></el-table-column>
            <el-table-column prop="action" label="操作" align="center" width="200px">
                <template slot-scope="scope">
                    <el-button type="text"  @click="deletes(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </elTable>
        </dialogs>
        <dialogs 
            :visible="showAreaDialog"
            title="查看店铺"
            width="600px"
        >
        <elTable :formData="formData" @tableData="getList" ref="dataInfo">
            <el-table-column prop="group" label="省" align="center"></el-table-column>
            <el-table-column prop="group" label="市" align="center"></el-table-column>
            <el-table-column prop="group" label="区" align="center"></el-table-column>
            <el-table-column prop="group" label="状态：限销/可销" align="center"></el-table-column>
            <el-table-column prop="action" label="操作" align="center" width="200px">
                <template slot-scope="scope">
                    <el-button type="text"  @click="deletes(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </elTable>
        </dialogs>
    </div>
</template>
<script>
import elTable from "@/components/xForm/elTable"
export default {
    name: 'saleRestrictionSuppliersDetail',
    components: {
        elTable
    },
    data () {
        return {
            formData: {
                currentPage: 1,
                pageSize: 10,
            },
            showPharmacyDialog: {
                show: false
            },
            showAreaDialog: {
                show: false
            },
            searchArray: [
                {
                    type: "input",
                    placeholder: "请输入产品名称",
                    types: "text",
                    value: "",
                    label: "产品名称"
                },
                {
                    type: "input",
                    placeholder: "请输入供应商产品ID",
                    types: "text",
                    value: "",
                    label: "供应商产品ID"
                },
                {
                    type: "input",
                    placeholder: "请输入批准文号",
                    types: "text",
                    value: "",
                    label: "批准文号"
                },
                {
                    type: "input",
                    placeholder: "请输入生产厂商",
                    types: "text",
                    value: "",
                    label: "生产厂商"
                },
                {
                    type: "select",
                    placeholder: "请选择",
                    value: "",
                    label: "收货省",
                    list: []
                },
                {
                    type: "select",
                    placeholder: "请选择",
                    value: "",
                    label: "收货市",
                    list: []
                },
                {
                    type: "select",
                    placeholder: "请选择",
                    value: "",
                    label: "收货区",
                    list: []
                },
                {
                    type: "input",
                    placeholder: "请输入药店查询",
                    types: "text",
                    value: "",
                    label: "药店查询"
                },
                {
                    type: "select",
                    placeholder: "请选择",
                    value: "",
                    label: "禁销/可销",
                    list: []
                },
            ],
        }
    },
    methods: {
        getList(pageNo) {
            let dataInfo = [
                {
                    id: 1,
                    name: "你好",
                    createTime: '1595244696000'
                },
                {
                    id: 2,
                    name: "你好1",
                    createTime: '1595244696000'
                },
            ];
            let total = 10;
            this.$nextTick(() => {
                this.$refs.dataInfo.loadData(dataInfo, total);
            })
        },
        pharmacySetting () {
            this.showPharmacyDialog.show = true
        },
        areaSetting () {
            this.showAreaDialog.show = true
        },
        deletes () {

        },
        goAdds () {
            this.$router.push({
                path: '/goods/saleRestrictionSuppliers/detail/addProductAndPhamacy'
            })
        },
        goAddsArea () {
            this.$router.push({
                path: '/goods/saleRestrictionSuppliers/detail/addProductAndArea'
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.sale-retriction-suppliers-detail {
    .search-form {
        margin-bottom: 16px;
    }
}
</style>